package org.wang.portal.util;

/**
 * @author: wangchao
 * @Date: 2025/2/11 08:56
 * @Description: ShellUtil
 * @since 7.0.0
 **/

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class ShellUtil {
    public static void executeScript(String scriptPath) {
        try {
            Process process = Runtime.getRuntime().exec("sh " + scriptPath);
            process.waitFor();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public static void executeCommand(String command) {
        try {
            Process process = Runtime.getRuntime().exec(command);
            process.waitFor();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
